#!/usr/local/bin/perl -w 
use DBI;
$table = "table"; $db = "base"; $db_serv = "192.168.0.1"; $user = "user"; $passwd = "password";
$c = DBI->connect("DBI:mysql:$db:$db_serv", $user, $passwd);
$statement = "select count(*) from $table";
$cc = $c->prepare($statement);
$ccc = $cc->execute;
@row = $cc->fetchrow_array;
$n = $row[0];
$statement = "select * from $table";
$cc = $c->prepare($statement);
$ccc = $cc->execute;
open F, "$ARGV[0]";
for ($i=0; $i<$n; $i++) {
@row = $cc->fetchrow_array;
print F "$row[0];$row[1];$row[3]\n";
}
